package com.guguskins.back.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-08-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("gu_withdrawal")
public class GuWithdrawal extends Model<GuWithdrawal> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "withdrawal_id", type = IdType.AUTO)
    private Long withdrawalId;

    /**
     * 该笔报价的唯一uuid，报价发起成功后，可以用该uuid查询报价状态
     */
    private String withdrawalUid;

    /**
     * 报价单状态；0表示机器人正在排队处理中，1表示报价交易成功，2表示报价已失败(取消报价也是报价失败)，11表示机器人提交报价中，12表示报价发起成功，已经从steam获取到steam报价单号，13表示机器人报价发起完毕，报价单激活中，等待客户接收报价；
     */
    private Integer withdrawalState;

    /**
     * 提现用户
     */
    private Long withdrawalUserId;

    /**
     * 提现用户steamId
     */
    private String withdrawalUserSteamId;
    private String withdrawalUserNickname;
    private Long withdrawalInventoryId;

    /**
     * 提现机器人steamId
     */
    private String withdrawalBotSteamId;

    /**
     * 要交易的我方饰品列表，如果交易我方
     */
    private String withdrawalMyItems;
    @TableField(exist = false)
    private GuStock stock;
    @TableField(exist = false)
    private String stockMarketName;

    /**
     * 要交易的对方饰品列表，如果不请求对方饰品
     */
    private String withdrawalTheirItems;

    /**
     * 交易连接
     */
    private String withdrawalTradeurl;

    /**
     * 订单取消时长，单位毫秒；报价发起后超过该时长后，机器人自动取消报价
     */
    private Long withdrawalCancelTime;

    /**
     * steam报价单附带的报价描述信息,
     */
    private String withdrawalMessage;

    /**
     * 机器人报价失败时返回的错误描述
     */
    private String withdrawalBotMessage;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime withdrawalCreateTime;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime withdrawalUpdateTime;


    @Override
    protected Serializable pkVal() {
        return this.withdrawalId;
    }

}
